home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
STRINGS
/
PACKAGE6
/
CARDINAL.DOC
next >
Wrap
Text File
|
1990-07-25
|
1KB
|
39 lines
-----------------------------------------------------------------------------
ReadLnCardinal
-----------------------------------------------------------------------------
declaration: procedure ReadLnCardinal (var CardinalNumber:
integer;
var LastKey:
TypeKey);
purpose: Reads in numbers allowing only 0..9, Escape, Enter,
Backspace, and keeps a running tally of the number
to prevent from exceeding MaxInt
pre-condition: CardinalNumber is un-defined, LastKey is undefined
post-condition: CardinalNumber is set to 0 if Escape is pressed, and
keeps value if Enter is pressed
special cases: none
example: var Number:
integer;
var LastKey:
TypeKey;
begin
.
.
.
ReadLnCardinal (Number, LastKey);
if LastKey <> EscapeKey then
write (output, Number);
.
.
.
end
-----------------------------------------------------------------------------